<nz-table
  nzShowPagination
  [nzFrontPagination]="false"
  nzSize="small"
  [nzOuterBordered]="true"
  nzShowSizeChanger
  [nzBordered]="true"
  [nzData]="_dataList"
  [nzTotal]="tableConfig!.total"
  [nzPageIndex]="tableConfig.pageIndex"
  [nzScroll]="tableConfig.needNoScroll ? {} : { x: '1100px' }"
  [nzPageSize]="tableConfig.pageSize"
  (nzQueryParams)="onPageChange($event)"
  (nzPageSizeChange)="onPageSizeChange($event)"
  [nzLoading]="tableConfig.loading"
  nzShowQuickJumper
  [nzShowTotal]="rangeTemplate"
>
  <ng-template #rangeTemplate let-range="range" let-total>
    {{ range[0] }}-{{ range[1] }} 共 {{ total }} 条</ng-template
  >
  <thead>
    <tr>
      <th
        nzEllipsis
        [nzLeft]="true"
        [nzIndeterminate]="indeterminate"
        *ngIf="tableConfig.showCheckbox"
        (nzCheckedChange)="onAllChecked($event)"
        [nzWidth]="'40px'"
        [nzChecked]="allChecked"
      ></th>
      <th
        nzEllipsis
        [nzWidth]="head.width + 'px'"
        *ngFor="
          let head of tableConfig.headers;
          trackBy: trackByTableHead;
          let headIndex = index
        "
        [nzRight]="!!head.fixed"
      >
        {{ head.title }}
      </th>
    </tr>
  </thead>
  <tbody>
    <tr
      *ngFor="
        let row of _dataList;
        let rowIndex = index;
        trackBy: trackByTableBody
      "
    >
      <td
        nzEllipsis
        *ngIf="tableConfig.showCheckbox"
        [nzLeft]="true"
        (nzCheckedChange)="checkRowSingle($event, rowIndex)"
        [nzChecked]="row['_checked']"
      ></td>
      <td
        [ngClass]="head.tdClassList ? head.tdClassList : ''"
        [nzEllipsis]="!head.notNeedEllipsis"
        *ngFor="let head of tableConfig.headers"
        [nzRight]="!!head.fixed"
      >
        <ng-container *ngIf="head.tdTemplate; else rowTpl">
          <ng-container
            *ngTemplateOutlet="head.tdTemplate; context: row"
          ></ng-container>
        </ng-container>
        <ng-template #rowTpl>
          <ng-container *ngIf="head.pipe; else noPipe"
            ><span [title]="row[head.field!] | map: head.pipe">{{
              row[head.field!] | map: head.pipe
            }}</span></ng-container
          >
          <ng-template #noPipe>
            <ng-container
              ><span [title]="row[head.field!]">{{
                row[head.field!]
              }}</span></ng-container
            >
          </ng-template>
        </ng-template>
      </td>
    </tr>
  </tbody>
</nz-table>
